/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, {Component} from 'react';
import {
    StyleSheet,
    Text,
    View
} from 'react-native';
import MainScreen from './views/test/MainScreen'
export default class App extends Component<{}> {
    constructor(props) {
        super(props);
        this.state = {
            remove: false,
        }
    }

    render() {
        let view = this.state.remove ? null : <MainScreen/>
        let text = this.state.remove ? '让他复活' : '干掉他'
        return (
            <View style={styles.container}>
                <Text onPress={() => {
                    this.setState({remove: !this.state.remove})
                }}>{text}</Text>
                {view}
            </View>
        );
    }
}

const styles = StyleSheet.create({
    container: {
        flex: 1,
        justifyContent: 'center',
        alignItems: 'center',
        backgroundColor: '#F5FCFF',
    },
    welcome: {
        fontSize: 20,
        textAlign: 'center',
        margin: 10,
    },
    instructions: {
        textAlign: 'center',
        color: '#333333',
        marginBottom: 5,
    },
});
